package com.cskaoyan.typehandler;
import java.sql.CallableStatement;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.sql.SQLException;

import org.apache.ibatis.type.BaseTypeHandler;

import org.apache.ibatis.type.JdbcType;

import org.apache.ibatis.type.MappedJdbcTypes;

import org.apache.ibatis.type.BaseTypeHandler;

public class BooleanTypeHandler extends BaseTypeHandler {
    @Override
    public void setNonNullParameter(PreparedStatement preparedStatement, int i, Object o, JdbcType jdbcType) throws SQLException {

    }

    @Override

    public Boolean getNullableResult(ResultSet rs, String arg1) throws SQLException {
        return 1 == rs.getInt(arg1);

    }

    @Override

    public Boolean getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
        return 1 == rs.getInt(columnIndex);

    }

    @Override

    public Boolean getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
        return 1 == cs.getInt(columnIndex);

    }



}

